/*************************************************
filename	: animatable.h
author		: Stefan lulham
desc		: An animatable is something that can contain 
				a series of frames which make up an animation.
				Animations as accessed by a string key for example
				you can create an animation called "walk".
*************************************************/
#ifndef D_ANIMATABLE_H
#define D_ANIMATABLE_H

#include <string>
#include <map>
#include <modules\graphics\animation.h>

using namespace std;

namespace DelGE
{
	namespace Modules
	{
		namespace Graphics
		{
			class Animatable
			{
			protected:
				map<string, Animation*> mAnimaitonMap;
				Animation* pCurrentAnimation;

				Animatable();
				virtual ~Animatable();

				void DestroyAnimations();

			public:
				void AddAnimation(string sName, int iStartFrame, int iEndFrame, float fFPS = 30.0f);
				void RemoveAnimation(string sName);
				Animation* GetAnimation(string sName);
				Animation* GetAnimation(int iIndex);
				Animation* GetCurrentAnimation();
				map<string, Animation*>& GetAnimationMap();
				void PlayAnimation(string sName, DelGEGraphics_Animation_Playstyle ePlaystyle = DelGEGraphics_Animation_Playstyle_Once);
				void StopAnimation();
				void PauseAnimation();
				void ResumeAnimation();
				bool IsAnimationPlaying(string sName = "");
				int GetAnimationCount();

				virtual void UpdateAnimation(float fDelta) = 0;
			};
		}
	}
}

#endif
